'''
Created on 31.10.2012

@author: Michael
@brief: Contains the Fruit class.
'''

import random

from food import Food
import settings

class Fruit(Food):
    """A fruit (apple) on the antground."""
    def __init__(self):
        """Creates the fruit. carrying ants, contains the ants, whos
        taking the food in the moment.
        """
        Food.__init__(self, random.randint(settings.FRUIT_AMOUNT_MIN,
                                           settings.FRUIT_AMOUNT_MAX))
        self.carrying_ants = []

    def needs_more_carriers(self, colony):
        """Checks if the of your colony can take the fruit."""
        load = 0
        for ant in self.carrying_ants:
            if ant.colony == colony:
                load += ant.current_load
        return load < self.amount
                

    
        
        
